/**
 * <copyright>
 * </copyright>
 *

 */
package de.rwth.adroidGuiLang.impl;

import de.rwth.adroidGuiLang.*;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class AdroidGuiLangFactoryImpl extends EFactoryImpl implements AdroidGuiLangFactory
{
  /**
   * Creates the default factory implementation.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public static AdroidGuiLangFactory init()
  {
    try
    {
      AdroidGuiLangFactory theAdroidGuiLangFactory = (AdroidGuiLangFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.rwth.de/AdroidGuiLang"); 
      if (theAdroidGuiLangFactory != null)
      {
        return theAdroidGuiLangFactory;
      }
    }
    catch (Exception exception)
    {
      EcorePlugin.INSTANCE.log(exception);
    }
    return new AdroidGuiLangFactoryImpl();
  }

  /**
   * Creates an instance of the factory.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AdroidGuiLangFactoryImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public EObject create(EClass eClass)
  {
    switch (eClass.getClassifierID())
    {
      case AdroidGuiLangPackage.WINDOW: return createWindow();
      case AdroidGuiLangPackage.BOX: return createBox();
      case AdroidGuiLangPackage.ONE_COLUMN_BOX: return createOneColumnBox();
      case AdroidGuiLangPackage.TWO_COLUMN_BOX: return createTwoColumnBox();
      case AdroidGuiLangPackage.TWO_COLUMN_LINE: return createTwoColumnLine();
      case AdroidGuiLangPackage.THREE_COLUMN_BOX: return createThreeColumnBox();
      case AdroidGuiLangPackage.THREE_COLUMN_LINE: return createThreeColumnLine();
      case AdroidGuiLangPackage.RADIO_BOX: return createRadioBox();
      case AdroidGuiLangPackage.SEPERATOR_LINE: return createSeperatorLine();
      case AdroidGuiLangPackage.RADIO_BUTTON: return createRadioButton();
      case AdroidGuiLangPackage.CHECKED_RADIO_BUTTON: return createCheckedRadioButton();
      case AdroidGuiLangPackage.UNCHECKED_RADIO_BUTTON: return createUncheckedRadioButton();
      case AdroidGuiLangPackage.GUI_ELEMENT: return createGuiElement();
      case AdroidGuiLangPackage.BUTTON: return createButton();
      case AdroidGuiLangPackage.PLACEHOLDER: return createPlaceholder();
      case AdroidGuiLangPackage.IMAGE: return createImage();
      case AdroidGuiLangPackage.CHECK_BOX: return createCheckBox();
      case AdroidGuiLangPackage.CHECKED_CHECK_BOX: return createCheckedCheckBox();
      case AdroidGuiLangPackage.UNCHECKED_CHECK_BOX: return createUncheckedCheckBox();
      case AdroidGuiLangPackage.LABEL: return createLabel();
      case AdroidGuiLangPackage.EDIT_TEXT: return createEditText();
      default:
        throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object createFromString(EDataType eDataType, String initialValue)
  {
    switch (eDataType.getClassifierID())
    {
      case AdroidGuiLangPackage.COLORS:
        return createColorsFromString(eDataType, initialValue);
      default:
        throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String convertToString(EDataType eDataType, Object instanceValue)
  {
    switch (eDataType.getClassifierID())
    {
      case AdroidGuiLangPackage.COLORS:
        return convertColorsToString(eDataType, instanceValue);
      default:
        throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Window createWindow()
  {
    WindowImpl window = new WindowImpl();
    return window;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Box createBox()
  {
    BoxImpl box = new BoxImpl();
    return box;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public OneColumnBox createOneColumnBox()
  {
    OneColumnBoxImpl oneColumnBox = new OneColumnBoxImpl();
    return oneColumnBox;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public TwoColumnBox createTwoColumnBox()
  {
    TwoColumnBoxImpl twoColumnBox = new TwoColumnBoxImpl();
    return twoColumnBox;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public TwoColumnLine createTwoColumnLine()
  {
    TwoColumnLineImpl twoColumnLine = new TwoColumnLineImpl();
    return twoColumnLine;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ThreeColumnBox createThreeColumnBox()
  {
    ThreeColumnBoxImpl threeColumnBox = new ThreeColumnBoxImpl();
    return threeColumnBox;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ThreeColumnLine createThreeColumnLine()
  {
    ThreeColumnLineImpl threeColumnLine = new ThreeColumnLineImpl();
    return threeColumnLine;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public RadioBox createRadioBox()
  {
    RadioBoxImpl radioBox = new RadioBoxImpl();
    return radioBox;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SeperatorLine createSeperatorLine()
  {
    SeperatorLineImpl seperatorLine = new SeperatorLineImpl();
    return seperatorLine;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public RadioButton createRadioButton()
  {
    RadioButtonImpl radioButton = new RadioButtonImpl();
    return radioButton;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public CheckedRadioButton createCheckedRadioButton()
  {
    CheckedRadioButtonImpl checkedRadioButton = new CheckedRadioButtonImpl();
    return checkedRadioButton;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public UncheckedRadioButton createUncheckedRadioButton()
  {
    UncheckedRadioButtonImpl uncheckedRadioButton = new UncheckedRadioButtonImpl();
    return uncheckedRadioButton;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public GuiElement createGuiElement()
  {
    GuiElementImpl guiElement = new GuiElementImpl();
    return guiElement;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Button createButton()
  {
    ButtonImpl button = new ButtonImpl();
    return button;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Placeholder createPlaceholder()
  {
    PlaceholderImpl placeholder = new PlaceholderImpl();
    return placeholder;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Image createImage()
  {
    ImageImpl image = new ImageImpl();
    return image;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public CheckBox createCheckBox()
  {
    CheckBoxImpl checkBox = new CheckBoxImpl();
    return checkBox;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public CheckedCheckBox createCheckedCheckBox()
  {
    CheckedCheckBoxImpl checkedCheckBox = new CheckedCheckBoxImpl();
    return checkedCheckBox;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public UncheckedCheckBox createUncheckedCheckBox()
  {
    UncheckedCheckBoxImpl uncheckedCheckBox = new UncheckedCheckBoxImpl();
    return uncheckedCheckBox;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Label createLabel()
  {
    LabelImpl label = new LabelImpl();
    return label;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EditText createEditText()
  {
    EditTextImpl editText = new EditTextImpl();
    return editText;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Colors createColorsFromString(EDataType eDataType, String initialValue)
  {
    Colors result = Colors.get(initialValue);
    if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String convertColorsToString(EDataType eDataType, Object instanceValue)
  {
    return instanceValue == null ? null : instanceValue.toString();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AdroidGuiLangPackage getAdroidGuiLangPackage()
  {
    return (AdroidGuiLangPackage)getEPackage();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @deprecated
   * @generated
   */
  @Deprecated
  public static AdroidGuiLangPackage getPackage()
  {
    return AdroidGuiLangPackage.eINSTANCE;
  }

} //AdroidGuiLangFactoryImpl
